package com.study.spark.scala.chapter06

import com.study.spark.scala.chapter06.Scala10_Object_Trait.Pserson

object Scala10_Object_Trait_1 {
  def main(args: Array[String]): Unit = {
    // TODO 面向对象 - 特质
    // 可以将trait理解为抽象类和接口的结合体

    val p1 = new Person with Runnable {
      override def run(): Unit = {
        println("aaa")
      }
    }
    p1.run()

      
  }
  trait Runnable{
    def run():Unit
  }



  class Person {
    def insertPerson(): Unit ={
      println("insert person...")
    }
  }
}


